#include "stdio.h"
char a[8]="CDEFGAB";
char x[80],y[80];

void tra()
{
int i;
for(i=0;x[i];i++)
y[i]=a[x[i]-'0'-1];
y[i]='\0';

}


/*Caution: you can only change codes in function above*/

main()
{  int i;
   FILE *fp1, *fp2;
   printf("\n Input:");
   scanf("%s",x);
   tra();
   printf("Result:%s\n",y);


   if ((fp1=fopen("k:\pin2.dat","r"))==NULL)
   { printf("Open file error,Please contact your teacher");
     exit(0);
     };
   if ((fp2=fopen("k:\my.dat","w"))==NULL)
   { printf("!Create file error,Please tell your teacher at once!");
     exit(0);
     };

   fscanf(fp1,"%s",x);
   tra();
   for(i=0;i<9;i++)
       fprintf(fp2,"%c\n",y[i]);

   fclose(fp2);
   fclose(fp1);
}

